package sctu.edu.java.year2016.team05.xiongyihui.day20160522.chapter4_2;

/**
 * Created by 熊怡惠 on 2016/5/22.
 * 编写JAVA程序，应用for循环打印菱形。
 */
public class two {
    public static void main(String[] args) {
        int i, j, k;
        for (i = 0; i < 5; i++) {
            for (j = 0; j < 5 - i; j++)
                System.out.print(" ");
            for (k = 0; k < 2 * i - 1; k++)
                System.out.print("*");
            System.out.print("\n");
        }
        for (i = 3; i > 0; i--) {
            for (j = 0; j < 5 - i; j++)
                System.out.print(" ");
            for (k = 0; k < 2 * i - 1; k++)
                System.out.print("*");
            System.out.print("\n");
        }

    }
}